package com.spring.boot.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.spring.boot.entity.Authority;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * @author 刘骄阳
 * 2021-07-15 20:11
 */
@Repository
public interface AuthorityDao extends BaseMapper<Authority> {

    /**
     * 获取指定角色的权限
     *
     * @param id 角色id
     * @return 权限
     */
    @Select("SELECT " +
            " ra.authority_id AS authorityId  " +
            "FROM " +
            " role_authority ra  " +
            "WHERE " +
            " ra.role_id =#{id}")
    String checkAuthority(Integer id);
}
